<!DOCTYPE html>
<html><head>
	    <meta charset="utf-8">
    <title>ThinkPHP5.0</title>

   {include file="public/head"}
    
</head>
<body>
	<!-- 头部 -->
	{include file="public/nav"}

	<!-- /头部 -->
	
	<div class="main-container container-fluid">
		<div class="page-container">
			            <!-- Page Sidebar -->
            {include file="public/left"}
            <!-- /Page Sidebar -->
            <!-- Page Content -->
            <div class="page-content">
                <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                                        <li>
                        <a href="{:url('Index/index')}">首页</a>
                    </li>
                    <li class="active">系统设置</li>
                                        <li class="active">配置管理</li>
                                        </ul>
                </div>
                <!-- /Page Breadcrumb -->

                <!-- Page Body -->
                <div class="page-body">
                    
<button style="display: inline-block;" type="button" tooltip="添加用户" class="btn btn-sm btn-azure btn-addon" onClick="javascript:window.location.href = '{:url('Conf/add')}'"> <i class="fa fa-plus"></i> Add
</button>
<button style="margin-left: 20px;display: inline-block;" id='del' class="btn btn-sm btn-danger">删除选中</button>
<div class="row">
    <div class="col-lg-12 col-sm-12 col-xs-12">
        <div class="widget">
            <div class="widget-body">
                <div class="flip-scroll">
                    <table class="table table-bordered table-hover">
                        <thead class="">
                            <tr>
                                <th width="5%" class="text-center"><input style="opacity:0.9;position: static;" type="checkbox" id="0"></th>
                                <th class="text-center" width="8%">ID</th>
                                <th class="text-center">中文名称</th>
                                <th class="text-center">英文名称</th>
                                <th class="text-center">值\默认值</th>
                                <th class="text-center">可选值</th>
                                <th class="text-center" width="12%">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            {volist name="data" id='vo'}
                            <tr>
                                <td class="text-center"><input style="opacity:0.9;position: static;" type="checkbox" id="{$vo.id}" class="checkboxs"></td>
                                <td align="center">{$vo.id}</td>
                                <td align="center">{$vo.cname}</td>
                                <td align="center">{$vo.ename}</td>
                                <td align="center">
                                    {if condition="$vo['value'] eq ''"}
                                    暂未设置默认值
                                    {else /}
                                    {$vo.value}
                                    {/if}
                                </td>
                                <td align="center">
                                    {if condition="$vo['values'] eq ''"}
                                    无
                                    {else /}
                                    {$vo.values}
                                    {/if}
                                </td>
                                <td align="center">
                                    <a href="{:url('Conf/edit')}" class="btn btn-primary btn-sm shiny">
                                        <i class="fa fa-edit"></i> 编辑
                                    </a>
                                    <a href="#" onClick="warning('确实要删除吗', '{:url('Conf/del',array('id'=>$vo['id']))}')" class="btn btn-danger btn-sm shiny">
                                        <i class="fa fa-trash-o"></i> 删除
                                    </a>
                                </td>
                            </tr>
                            {/volist}
                        </tbody>
                    </table>
                </div>
                <div>
                	                </div>
            </div>
        </div>
    </div>
</div>

                </div>
                <!-- /Page Body -->
            </div>
            <!-- /Page Content -->
		</div>	
	</div>

{include file="public/foot"}
<script type="text/javascript">
    $('#del').click(function(){
        layer.confirm('您确定要删除选中项？', {
          btn: ['确定','取消'] //按钮
        }, function(){
            var data=[];
            var i=0;
            $('.checkboxs').each(function(){
                if($(this).is(':checked')){
                    var id=$(this).attr('id');
                     data[i]=id;
                     i++;
                }
        });
        var url="{:url('Conf/ajaxdel')}";
        $.post(url,{data},function(res){
            if(res.status==0){
                layer.alert(res.msg, {icon: 5});
            }else{
                layer.alert(res.msg, {icon: 6});
                location.reload();
            }
        },'json');






          
        }, function(){
          return;
        });
    });

    $('#0').change(function(){
        if($(this).is(':checked')){
            $('.checkboxs').prop('checked','checked');
        }else{
            $('.checkboxs').prop('checked',false);
        }
    });



</script>
    


</body></html>